﻿@using Cloud.Dto
@model SysUserDto
@{
    Layout = null;
    var roleList= ViewBag.roleList as List<RoleDto>;
}
<style>
    .modal-dialog {
        width: 400px;
    }
</style>
<form action="@Url.Action("Edit")" class="form-horizontal">
    @Html.AntiForgeryToken()
    <input type="hidden" name="LoginID" value="@Model.LoginID" />
    <div class="form-group">
        <label class="col-sm-3 control-label no-padding-right" for="LoginName">登录名</label>
        <div class="col-sm-9">
            <input type="text" id="LoginName" name="LoginName" value="@Model.LoginName" class="col-xs-10">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label no-padding-right" for="LoginPwd">登录密码</label>
        <div class="col-sm-9">
            <input type="text" id="LoginPwd" name="LoginPwd" value="@Model.LoginPwd" class="col-xs-10">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label no-padding-right" for="Phone">手机号</label>
        <div class="col-sm-9">
            <input type="text" id="Phone" name="Phone" value="@Model.Phone" class="col-xs-10">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label no-padding-right" for="Phone">管理员</label>
        <div class="col-sm-9">
            <label>
                <input name="IsAdmin" class="ace ace-switch ace-switch-5" value="true" @(Model.IsAdmin?"checked='checked'":"") type="checkbox">
                <span class="lbl"></span>
            </label>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label  no-padding-right" for="Phone">所属角色</label>
        <div class="col-sm-9">
            <select multiple="" class="chosen-select form-control tag-input-style" name="RoleIdList" data-placeholder="选择角色" asp-items="roleList.Select(c=>new SelectListItem {Value=c.RoleId.ToString(),Text=c.RoleName,Selected=(Model.RoleList.Any(e=>e.RoleId==c.RoleId)) }).ToList()">

            </select>
        </div>
    </div>
</form>

<script>
    $(function () {
        $(".chosen-select").chosen();
        $(".chosen-container-single").css("width", "83%");
        $(".chosen-container-multi").css("width", "83%");
    });
</script>